import argparse
from .server import Server
from .color import Color
+from .constants import SIRIDBC
def is_valgrind_installed():
return True
+def print_siridb_version(args):
+ fn = SIRIDBC.format(BUILDTYPE=args.build)
+ try:
+ p = subprocess.Popen(
+ [fn, '--version'],
+ stdout=subprocess.PIPE,
+ stderr=subprocess.PIPE)
+ except FileNotFoundError:
+ print(Color.error(f'Cannot find: {fn}'))
+ exit(1)
+
+ output, err = p.communicate()
+ rc = p.returncode
+ if rc or err:
+ print(Color.error(f'Cannot use: {fn}'))
+ exit(1)
+
+ print(f'Test with: {Color.info(output.decode().splitlines()[0])}')
+
+
def parse_args():
parser = argparse.ArgumentParser()
has_valgrind = is_valgrind_installed()
+ print_siridb_version(args)
print("Test using valgrind for memory errors and leaks: ", end='')
if args.mem_check and not has_valgrind:
print(Color.warning('disabled (!! valgrind not found !!)'))
from .constants import SIRIDBC
from .constants import TEST_DIR
from .constants import VALGRIND
-from .constants import BUILDTYPE
from .constants import MAX_OPEN_FILES
MEM_PROC = \
HOLD_TERM = False
GEOMETRY = '140x60'
MEM_CHECK = False
- BUILDTYPE = BUILDTYPE
+ BUILDTYPE = 'Release'
SERVER_ADDRESS = '%HOSTNAME'
IP_SUPPORT = 'ALL'
TERMINAL = None # one of [ 'XTERM', 'XFCE4_TERMINAL', None ]